package cn.byapps.hw.dao;

import cn.byapps.hw.entity.TeacherFile;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TeacherFileDao extends JpaRepository<TeacherFile, String> {
    /**
     * 根据作业ID查询
     *
     * @param homeworkId
     * @return
     */
    @Query("select (u) from TeacherFile u where u.homework.id = :homeworkId")
    List<TeacherFile> getByHomeworkId(Integer homeworkId);
}
